<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="keywords" content="乌鲁木齐市存量房交易系统,乌鲁木齐房产交易,存量房交易系统" />
    <meta name="description" content="乌鲁木齐市存量房交易系统,乌鲁木齐房产交易,存量房交易系统" />
    <meta http-equiv="Pragma" content="no-cache"/>
	<meta http-equiv="Cache-Control" content="no-cache"/>
	<meta http-equiv="Expires" content="0"/>
	
    <title>乌鲁木齐市存量房交易系统-贷款申请列表</title>
    
    <link rel="stylesheet" type="text/css" href="../../frontJS/paging/paging.css" />
	<link rel="stylesheet" type="text/css" href="../../frontStyle/dialog.css" />
	<link rel="stylesheet" type="text/css" href="../../frontStyle/frame.css" />
	<link rel="stylesheet" type="text/css" href="../../frontStyle/countState.css" />
    <script type="text/javascript" src="../../frontJS/jquery.min-1.9.1.js"></script>
    <script type="text/javascript" src="../../frontJS/paging/paging.js"></script>
	<script type="text/javascript" src="../../frontJS/base-config/base.js"></script>
	<script type="text/javascript" src="../../frontJS/dkysl/loanApplyList.js"></script>

</head>
<body>
<div class="tb_container">
    <div class="top-xm fund-div">
        <p class="fund-p">
            <input type="text" placeholder="按不动产或房产证号搜索"/>
            <input type="text" placeholder="按贷款单号搜索"/>
            <input type="text" placeholder="按申请人搜索"/>
            <input type="text" placeholder="按证件号码搜索"/>
            <input type="text" placeholder="按状态搜索"/>
            <span class="big"></span>
        </p>
        <p class="p_after">
            <a href="javascript:void(0)" class="afterArrow">贷款预受理</a>
            <a href="javascript:void(0)" class="afterArrow">贷款申请列表</a>
            <a href="javascript:window.location.reload();" class="reload">刷新</a>
            <a href="userManage.html" class="add reload">新增贷款</a>
        </p>
    </div>
    <div class="table-border fund-border">
        <div>
            <table class="payManage-table">
            	<thead>
            		<tr class="tr_th">
            			<th>序号</th>
                     	<th>不动产权证号</th>
                     	<th>房产证号</th>
                     	<th>贷款单号</th>
                     	<th>申请人</th>
                     	<th>证件号码</th>
                     	<th>状态</th>
                     	<th>操作</th>
                 	</tr>
            	</thead>
            </table>
        </div>

        <div class="foot">
            <p>共 <span class="totalPage">1</span>条记录&nbsp&nbsp <span class="currentPage">1</span>/<span class="totalPage">1</span>页</p>
            <div id="pageTool">

            </div>
        </div>
    </div>
</div>
<script>
function toPage(_num){
    var _tmp={};
    for(var i=0;i<storage.getStorage('dkyclData').length;i++){
        if(storage.getStorage('dkyclData')[i].houseInfo.houseNum == _num){
            _tmp = storage.getStorage('dkyclData')[i];
        }
    }
    storage.removeStorage('dkyclDataSingle')
    storage.setStorage('dkyclDataSingle',_tmp);

    window.location.href = 'loanPreDeal.html?right_num='+_num;
}

    $(function(){

        /*全局变量定义*/
        var prePage=15;
//        var currentPage=1;


        /*定义ajax发送成功之后执行的函数*/
        var ajax_suc=function(data,currentPage){

            //数据存储到本地存储中
            //storage.removeStorage('fangData');
            //storage.setStorage('fangData',data.info);

            var _html = '<tr class="tr_th">' +
                        '<th>序号</th>' +
                        '<th>房权证号</th>' +
                        '<th>贷款单号</th>' +
                        '<th>申请人</th>' +
                        '<th>证件号码</th> ' +
                        '<th>产权面积(m²)</th> ' +
                        '<th>房屋地址</th> ' +
                        '<th>状态</th> ' +
                        '<th>操作</th> ' +
                    '</tr>';
            for(var i=0;i<data.length;i++){

                var _stateDataInfo=['未处理','已通过','已拒绝'];

                if(data[i].status == 0){
                     _html += "<tr>" +
                    "<td>"+(prePage*(currentPage-1)+i+1)+"</td>" +
                    "<td>"+data[i].num+"</td>" +
                    "<td>"+data[i].orderNum+"</td>" +
                    "<td>"+data[i].name+"</td>" +
                    "<td>"+data[i].identityNum+"</td>" +
                    "<td>"+data[i].area+"</td>" +
                    "<td>"+data[i].address+"</td>" +
                    "<td class='noHandle'>"+_stateDataInfo[data[i].status]+"</td>" +
                    "<td><a href='javascript:toPage(\""+data[i].num+"\")' class='underline-a'>查看</a></td>" +
                    "</tr>";
                }
                if(data[i].status == 1){
                     _html += "<tr>" +
                    "<td>"+(prePage*(currentPage-1)+i+1)+"</td>" +
                    "<td>"+data[i].num+"</td>" +
                    "<td>"+data[i].orderNum+"</td>" +
                    "<td>"+data[i].name+"</td>" +
                    "<td>"+data[i].identityNum+"</td>" +
                    "<td>"+data[i].area+"</td>" +
                    "<td>"+data[i].address+"</td>" +
                    "<td>"+_stateDataInfo[data[i].status]+"</td>" +
                    "<td><a href='javascript:toPage(\""+data[i].num+"\")' class='underline-a'>查看</a></td>" +
                    "</tr>";
                }
                if(data[i].status == 2){
                     _html += "<tr>" +
                    "<td>"+(prePage*(currentPage-1)+i+1)+"</td>" +
                    "<td>"+data[i].num+"</td>" +
                    "<td>"+data[i].orderNum+"</td>" +
                    "<td>"+data[i].name+"</td>" +
                    "<td>"+data[i].identityNum+"</td>" +
                    "<td>"+data[i].area+"</td>" +
                    "<td>"+data[i].address+"</td>" +
                    "<td class='unPass'>"+_stateDataInfo[data[i].status]+"</td>" +
                    "<td><a href='javascript:toPage(\""+data[i].num+"\")' class='underline-a'>查看</a></td>" +
                    "</tr>";
                }

               

                
            }
            $('table').html(_html);
          
            /*table斑马线设置*/
            $('tr:even').css('background','#f5f5f5');
        };


        var ajax_suc_head=function(){
            var _html = '<tr class="tr_th">' +
                        '<th>序号</th>' +
                        '<th>房权证号</th>' +
                        '<th>贷款单号</th>' +
                        '<th>申请人</th>' +
                        '<th>证件号码</th> ' +
                        '<th>产权面积(m²)</th> ' +
                        '<th>房屋地址</th> ' +
                        '<th>状态</th> ' +
                        '<th>操作</th> ' +
                    '</tr>';
            $('table').html(_html);
          
            /*table斑马线设置*/
            $('tr:even').css('background','#f5f5f5');
        }





        /*从本地拿数据*/
        var _obtain = storage.getStorage('dkyclData');
        if(_obtain){
            if(_obtain.length){
                console.log('有数据');
                console.log(_obtain)

                var _info=[];
                for(var i=0;i<_obtain.length;i++){
                    var _tmp = {};

                    _tmp.num = _obtain[i].houseInfo.houseNum;
                    _tmp.orderNum = _obtain[i].code;
                    _tmp.name =  _obtain[i].proposerInfo.name;
                    _tmp.identityNum =  _obtain[i].proposerInfo.identity;
                    _tmp.area = _obtain[i].houseInfo.houseArea;
                    _tmp.address = _obtain[i].houseInfo.houseLocation;
                    _tmp.status = _obtain[i].proposerInfo.status;

                    _info.push(_tmp);
                }

                ajax_suc(_info,1);
            }else{
                console.log('无数据');
                ajax_suc_head();
            }
        }else{
            console.log('无数据');
            ajax_suc_head();
        }
        




        /*table样式设置*/
        $('tr:even').css('background','#f5f5f5');
        $('.tr_th').css('background','#d7e5f0');


        /*$('#pageTool').Paging({
            pagesize:10,
            count:20,
            callback:function(page,size,count){
                $('.totalPage').text(count);
                $('.currentPage').text(page)

            }
        });*/
        /*点击分页时候跟新页面*/


    })
</script>

</body>
</html>